#ifndef VALUEPROCESSOR_H
#define VALUEPROCESSOR_H

#include <QObject>
#include <QQueue>
#include <QTimer>

class ValueProcessor : public QObject
{
    Q_OBJECT

public:
    explicit ValueProcessor(QObject *parent = nullptr);
    void addValue(int a);
    void setInterval(int intervalMs);
    void startProcessing();

signals:
    void sendTopFocusData(int angle);
    void sendSideFocusData(int angle);

private slots:
    void onTimeout();

private:
    void splitAndEnqueue(int a);

    QQueue<int> queue;
    QTimer timer;
};

#endif // VALUEPROCESSOR_H
